package listdemo2;

import java.util.Iterator;
import java.util.List;
import java.util.ArrayList;

public class Test {
    public static void main(String[] args) {
        ArrayList <Integer>list = new ArrayList<>();
        list.add(1);
        list.add(2);
        list.add(3);
        list.add(4);
        list.add(5);
        //System.out.println(list);
        //System.out.println(list.subList(1,3).remove(1));
        //System.out.println(list);
        ArrayList <Integer>list2 = new ArrayList<>();
        list2.add(1);
        list2.addAll(list);
        System.out.println(list2);
        for (Integer x:list2) {
            System.out.println(x);
        }

    }
}
